package Invalid;
import java.awt.*;
import java.io.*;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.*;
import java.security.*;

class ClientWorker implements Runnable {
	Socket socket1 ,socket2;
//Constructor
  ClientWorker(Socket socket1 , Socket socket2 ) {
    this.socket1 = socket1;
    this.socket2 = socket2;
  }

  public void run(){
    BufferedReader in = null;
    PrintWriter out = null;
    
    try{
      in = new BufferedReader(new InputStreamReader(socket1.getInputStream()));
      out = new PrintWriter(socket2.getOutputStream(), true);
    } 
    catch (IOException e) {
      System.out.println("in or out failed");
      System.exit(-1);
    }


    while(true){
      try{
    	String line = in.readLine();
        out.println(line);
       }catch (Exception e) {
        System.out.println("Read failed");
        System.exit(-1);
       }
    }   
  }
}
